<?php
$this->breadcrumbs=array(
	'Admin Controller'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List OptionModel', 'url'=>array('index')),
	array('label'=>'Create OptionModel', 'url'=>array('create?model=option')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('option-model-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manage Option</h1>

<div class="form" align="left">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'create-option-form',
	'enableAjaxValidation'=>false,
                  'action'=>'/admin/create?model=option',
)); ?>
<?php echo CHtml::submitButton($label='Create Option');?>
<?php $this->endWidget(); ?>
</div>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'option-model-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		'option_name',
		'option_value',
		'option_type',
		'object_id',
		'parent_option',
		array(
                                        'class'=>'CButtonColumn',
                                        'viewButtonUrl' => 'Yii::app()->createUrl("/admin/view", array("id" => $data["id"],"model" => "option"))',
                                        'deleteButtonUrl' => 'Yii::app()->createUrl("/admin/delete", array("id" =>  $data["id"],"model" => "option"))',
                                        'updateButtonUrl' => 'Yii::app()->createUrl("/admin/update", array("id" =>  $data["id"],"model" => "option"))',
		),
	),
)); ?>
tion